{extend name="admin/base_pop" /}
{block name="resources"}
<script type="text/javascript" src="__STATIC__/My97DatePicker/WdatePicker.js"></script>
<style>
	.count-table .title{
		font-weight:bold;
		margin-bottom:10px;
	}
	.count-table span{
		display:inline-block;
		width:16%;
	}
	.table-class{border-top: 1px solid #E1E6F0}
</style>
{/block}
{block name="main"}

<table class="table-class" >
	<thead>
	<tr align="center">
		<th >编号</th>
		<th align="left">转出人</th>
		<th align="left">转入人</th>
		<th align="left">金额</th>
		<th align="left">时间</th>
	</tr>
	</thead>
	<tbody id="my-table"></tbody>
</table>
<input type="hidden" id="member_id" value="{$member_id}"/>
{/block}
{block name="script"}
<script type="text/javascript">
	function LoadingInfo(page_index) {

		var search_text = $("#search_text").val();
		var start_date = $("#startDate").val();
		var end_date = $("#endDate").val();
		var member_id = $("#member_id").val();
		var category = $("#category").val();
		$.ajax({
			type : "post",
			url : "{:__URL('ADMIN_MAIN/member/memberTransferList')}",
			data : {
				"page_index" : page_index,
				"page_size" : $("#showNumber").val(),
				"search_text":search_text,
				"member_id":member_id,
			},
			success : function(data) {
				if (data["data"].length > 0) {
					console.log(data["data"]);
					$("#my-table").empty();
					for (var i = 0; i < data["data"].length; i++) {
						var html = '';
						html += '<tr align="center">';
						html += '<td align="center">'+ data["data"][i]["id"] +'</td>';
						html += '<td align="left"><a href="'+__URL('SHOP_MAIN/admin/member/membertransferList?member_id='+data["data"][i]["from_uid"])+'" >'+data["data"][i]["from_user"]['user_name']+'<br>'+data["data"][i]["from_user"]['nick_name']+'</a></td>';
						html += '<td align="left"><a href="'+__URL('SHOP_MAIN/admin/member/membertransferList?member_id='+data["data"][i]["to_uid"])+'" >'+data["data"][i]["to_user"]['user_name']+'<br>'+data["data"][i]["to_user"]['nick_name']+'</a></td>';
						html += '<td align="left">'+data["data"][i]["money"]+'</td>';
						html += '<td align="left">'+timeStampTurnTime(data["data"][i]["create_time"])+'</td>';
						html += '</tr>';
					    html += '<input type="hidden" id="member_id" value="{$member_id}"/>';
						$("#my-table").append(html);
					}
				} else {
					var html = '<tr align="center"><td colspan="8">暂无符合条件的数据记录</td></tr>';
					$("#my-table").html(html);
				}
				initPageData(data["page_count"],data['data'].length,data['total_count']);
				$("#pageNumber").html(pagenumShow(jumpNumber,$("#page_count").val(),{$pageshow}));
			}
		});
	}

	function searchData(){
		LoadingInfo(1);
	}

	//点击显示更多搜索
	$(".more-search").click(function(){
		$(".more-search-container").slideToggle();
	})
</script>
{/block}